
$(function(){
    // var getQueryVariable = function getQueryVariable(variable) {
    //     var query = window.location.search.slice(1);
    //     var vars = query.split('&');
    //     for (var i = 0; i < vars.length; i++) {
    //         var pair = vars[i].split('=');
    //         if (decodeURIComponent(pair[0]) == variable) {
    //             return decodeURIComponent(pair[1]);
    //         }
    //     }
    //     console.log('Query variable %s not found', variable);
    // };
    // var productid = getQueryVariable("productid");
   var id = location.search.slice(1).split("=")[1]
   console.log(id);
   
    $.ajax({
        type:'get',
        url:"http://193.112.55.79:9090/api/getmoneyctrlproduct",
        data: { 'productid': id },
        dataType:"json",

        success:function(result){
            console.log(result)
            var html = template('moneyProduct', result)
            $('#recommen-product').html(html)
            console.log(html)
               
        }
    })
})